 <script th:inline="javascript">
/*<![CDATA[*/

    function del(event,element){
        event.preventDefault();
          bootbox.confirm("您确定删除吗?", function(result) {
        if(result){
            var _id = $(element).attr("href").split("_")[0];
            var _page = $(element).attr("href").split("_")[1];
            var _viewState = $(element).attr("href").split('_')[2];
            BOSS.remoteCall('system/deliver/delete',$('#div_deliver_grid'),{id: _id, page: _page, viewState: _viewState});
            }
        }); 
    }
    
/*]]>*/
</script>
<table layout:fragment="deliver_table" class="table table-striped table-bordered  table-advance table-hover" id="deliver_grid">
    <thead>
        <tr>
            <th>编号</th>
            <th>配送方式名称</th>
            <th>配送方式描述</th>
            <th>支持支付方式</th>
            <th>是否显示</th>
            <th>操作</th>
        </tr>
    </thead>    
    <tbody>
        <tr class="odd gradeX" th:each="data : ${deliverPage}">
            <td th:text="${data.id}">
            </td>
            <td  th:text="${data.name}">
            </td>
            <td th:text="${data.description}">
            </td>
            <td>
               <span  class="tagsinput border-striped">
                   <span th:each="deliverType:${data.deliverTypeList}" class="badge badge-danger" th:text="${deliverType.description}"></span>
               </span>
               <!-- <span th:switch="${data.type.description}" class="tagsinput border-striped">
                    <span th:case="在线支付" class='badge badge-danger'>
                            <span th:text="否"></span>
                    </span>
                    <span th:case="货到付款" class='badge badge-success'>
                            <span th:text="是"></span>
                    </span>
                </span>-->
            </td>
            <td>
                <span  class="tagsinput border-striped">
                    <span th:if="${data.displayed == false}" class='badge badge-danger'>
                            <span th:text="否"></span>
                    </span>
                    <span th:unless="${data.displayed == false}" class='badge badge-success'>
                            <span th:text="是"></span>
                    </span>
                </span>
            </td>
            <td class="col-md-3">
                <a th:attr="id=${'link_setArea_'+dataStat.index}" th:href="@{'/system/deliver/setArea/'+${data.id}}" class="btn default btn-xs purple"><i class="fa fa-plus"></i>设置区域</a>
                <a th:attr="id=${'link_edit_'+dataStat.index}" th:href="@{'/system/deliver/edit/'+${data.id}}" class="btn default btn-xs purple"><i class="fa fa-edit"></i>编辑</a>
                <a th:attr="id=${'link_delete_'+dataStat.index}" th:href="${data.id}+'_'+${deliverPage.number}+'_'+${viewState}" class="btn default btn-xs purple" onclick="del(event,this)"><i class="fa fa-minus"></i>移除</a>
            </td>         
        </tr>
     </tbody>
</table>
<div th:include="page_footer" th:with="viewState=${viewState},url=${'/system/deliver/index'},pageContext=${deliverPage}"></div>



